package algorithm.poj.p2000;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLDecoder;
import java.text.DecimalFormat;
import java.util.StringTokenizer;


/**
 * 分析：
 * 
 * 实现：
 * 
 * 经验：
 * 
 * 教训：
 * 
 * @author wong.tong@gmail.com
 *
 */
public class P2850 {

	public static void main(String[] args) throws Exception {

		InputStream input = null;
		if (false) {
			input = System.in;
		} else {
			URL url = P2850.class.getResource("P2850.txt");
			File file = new File(URLDecoder.decode(url.getPath(), "UTF-8"));
			input = new FileInputStream(file);
		}
		
		BufferedReader stdin = new BufferedReader(new InputStreamReader(input));
		
		DecimalFormat format = new DecimalFormat("##0.0000");
		String line = stdin.readLine();
		int N = Integer.valueOf(line.trim());
		for (int i = 0; i < N; i ++) {
			line = stdin.readLine();
			StringTokenizer st = new StringTokenizer(line);
			Integer m = Integer.valueOf(st.nextToken());
			Point[] ps = new Point[m];
			for (int j = 0; j < m; j ++) {
				ps[j] = new Point();
				ps[j].x = Double.valueOf(st.nextToken());
				ps[j].y = 1.0f;
			}
			Point p = cycle(ps);
			System.out.println((i+1) + ": " + format.format(p.x) + " " + format.format(p.y));
		}
	}
	
	private static Point cycle(Point[] ps) {

		for (int i = ps.length-1; i > -1; i --) {
			for (int j = 0; j < i; j ++) {
				ps[j] = cycle(ps[j], ps[j+1]);
			}
		}
		return ps[0];
	}
	
	/**
	 * 根据圆心在p1,p2的单位圆，计算与它们都外切的单位圆圆心位置
	 * @param p1
	 * @param p2
	 * @return
	 */
	private static Point cycle(Point p1, Point p2) {
		
		//x + u*y = v
		double u = (p2.y - p1.y)/(p2.x - p1.x);
		double v = ((p2.y + p1.y)*u  + (p2.x + p1.x))/2.0;
		
		//a*y^2 + b*y + c = 0
		double a = u*u + 1.0f;
		double b = 2.0f*u*(p1.x-v) - 2.0f*p1.y;
		double c = (p1.x-v)*(p1.x-v) + p1.y*p1.y - 4.0f;
		
		Point p = new Point();
		p.y = (-b + Math.sqrt(b*b - 4.0f*a*c))/(2.0*a);
		p.x = v - u*p.y;
		
		return p;
	}

	private static class Point {
		double x;
		double y;
	}
}
